<template name="userAccount">
  <div class="grid-small grid-module dialog user-edit">
  
  {{#if profileIncomplete}}
    <div>
      {{_ "please_complete_your_profile_below_before_continuing"}}
    </div>
    {{/if}}
    <form id="account-form">
      <h2>{{_ "account"}}</h2>
      <div class="control-group">
        <label>{{_ "username"}}</label>
        <div class="controls">
          <input id="username" name="username" disabled="disabled" type="text" value="{{userName}}" />
        </div>
        <p class="note">Profile URL: {{profileUrl}}</p>
      </div>
  <!--       <div class="control-group">
        <label>Email</label>
        <div class="controls">
          <input id="email" name="email" disabled="disabled" type="text" value="{{email}}" />
        </div>
      </div> -->
      <div class="control-group">
        <label>{{_ "display_name"}}</label>
        <div class="controls">
          <input name="name" type="text" value="{{profile.name}}" />
        </div>
      </div>
      <div class="control-group">
        <label>{{_ "email"}}</label>
        <div class="controls">
          <input name="email" type="text" value="{{userEmail}}" />
        </div>
      </div>
      <div class="control-group">
        <label>{{_ "bio"}}</label>
        <div class="controls"><textarea name="bio" type="text">{{profile.bio}}</textarea></div>
      </div>
      <div class="control-group">
      <label>{{_ "twitter_username"}}</label>
        <div class="controls">
          <input name="twitter" type="text" value="{{getTwitter}}" />
        </div>
      </div>
      <div class="control-group">
        <label>{{_ "github_username"}}</label>
        <div class="controls">
          <input name="github" type="text" value="{{getGitHub}}" />
        </div>
      </div>
      <div class="control-group">
        <label>{{_ "site_url"}}</label>
        <div class="controls">
          <input name="site" type="text" value="{{profile.site}}" />
        </div>
      </div>
      {{#if hasPassword}}
        <h3>{{_ "change_password"}}</h3>
        <div class="control-group">
          <label>{{_ "old_password"}}</label>
          <div class="controls"><input name="old_password" type="password" value="" /></div>
        </div>
        <div class="control-group">
          <label>{{_ "new_password"}}</label>
          <div class="controls"><input name="new_password" type="password" value="" /></div>
        </div>
      {{/if}}
      <div class="control-group">
        <label class="control-label">{{_ "email_notifications"}}</label>
        <div class="controls">
          {{#if isAdmin}}
            <label class="checkbox">
              <input id="notifications_users" type="checkbox" name="notifications_users" {{hasNotificationsUsers}} /> {{_ "new_users"}}
            </label>
          {{/if}}
          <label class="checkbox">
            <input id="notifications_posts" type="checkbox" name="notifications_posts" {{hasNotificationsPosts}} /> {{_ "new_posts"}}
          </label>
          <label class="checkbox">
            <input id="notifications_comments" type="checkbox" name="notifications_comments" {{hasNotificationsComments}} /> {{_ "comments_on_my_posts"}}
          </label>
          <label class="checkbox">
            <input id="notifications_replies" type="checkbox" name="notifications_replies" {{hasNotificationsReplies}} /> {{_ "replies_to_my_comments"}}
          </label>
        </div>
      </div>
      {{#if isAdmin}}
      <div class="control-group">
        <h3>Invites</h3>
        <label>Invites</label>
        <div class="controls">
          <input name="inviteCount" type="text" value="{{inviteCount}}" />
        </div>
      </div>
      {{/if}}
      <div class="form-actions">
        <a href="/forgot-password">{{_ "forgot_password"}}</a>
        <input type="submit" class="button" value="{{_ "submit"}}" />
      </div>
    </form>
    </div>
</template>